package o;

import android.os.RemoteException;
import android.text.TextUtils;
import android.util.Log;
import com.huawei.hmf.orb.aidl.communicate.DataBuffer;
import o.ffr.e;
import o.ffu.a;

public class fgh extends a {
    private final e ˏ;
    private final Class<? extends ffc> ॱ;

    public fgh(Class<? extends ffc> cls, e eVar) {
        this.ॱ = cls;
        this.ˏ = eVar;
    }

    public void ˊ(DataBuffer dataBuffer) throws RemoteException {
        if (dataBuffer == null || TextUtils.isEmpty(dataBuffer.ˋ)) {
            Log.e("IPCCallback", "URI cannot be null.");
            throw new RemoteException();
        }
        fib o_fib = new fib();
        fgw o_fgw = new fgw();
        o_fib.ˏ(dataBuffer.ˏ, o_fgw);
        ffc o_ffc = null;
        if (dataBuffer.ˏ() > 0) {
            o_ffc = ˋ();
            if (o_ffc != null) {
                o_fib.ˏ(dataBuffer.ˊ(), o_ffc);
            }
        }
        this.ˏ.ˎ(o_fgw.getStatusCode(), o_ffc);
    }

    protected ffc ˋ() {
        if (this.ॱ != null) {
            try {
                return (ffc) this.ॱ.newInstance();
            } catch (Throwable e) {
                Log.e("IPCCallback", "instancing exception.", e);
            } catch (Throwable e2) {
                Log.e("IPCCallback", "instancing exception.", e2);
            }
        }
        return null;
    }
}
